package com.dayou.controller;

import com.dayou.bean.SysDept;
import com.dayou.bean.SysUser;
import com.dayou.common.core.controller.BaseController;
import com.dayou.service.impl.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;


@Controller
public class SysIndexController extends BaseController {
    @Autowired
    private SysDeptService deptService;

    @GetMapping("/index")
    public String index() {
        //从会话中获取登录用户的信息，若为空，则跳转至登录页面
        SysUser loginUser = (SysUser) (getRequest().getSession().getAttribute("login_user"));
        if (null == loginUser) {
            return "sysUser/login";
        } else {
            return "sysUser/index";
        }
    }
}
